package com.kun.portal.webframe.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.kun.portal.webframe.util.Loaded;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;
import java.util.Set;

/**
 * Created by Administrator on 2018/5/7.
 */
@Entity
@Table(
        name = "fbo_flight_info"
)
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
@NamedEntityGraph(name = "flightInfoLazy",
        attributeNodes = {@NamedAttributeNode("maintenancePlanSettings"),
                @NamedAttributeNode("repairPlaneSettings")})
public class FlightInfoPo {
    @Id
    @GeneratedValue(
            generator = "flight_info_id"
    )

    @GenericGenerator(
            name = "flight_info_id",
            strategy = "uuid"
    )
    @Column(
            name = "flight_info_id",
            length = 32,
            nullable = false
    )
    private String flightInfoId;

    @Column(
            name = "manufacturing_no",
            length = 32

    )
    private String manufacturingNo;

    @Column(
            name = "effective"
    )
    private Boolean  effective=true;

    @Column(
            name = "make_date"

    )
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="Asia/Shanghai")
    @Temporal(TemporalType.DATE)
    private Date makeDate;

    public String getFlightKind() {
        return flightKind;
    }

    public void setFlightKind(String flightKind) {
        this.flightKind = flightKind;
    }

    @Column(
            name = "flight_kind",
            length= 32

    )
    private String flightKind;

    @Column(
           name = "flight_type",
            length= 32
    )
    private String flightType;

    @Column(
            name = "flight_num",
            length= 32
    )


    private String flightNum; //航班号
    @Column(
            name = "flight_no",
            length= 32
    )
    private String flightNo;//机号

    @Column(
            name = "engine_number",
            length= 32
    )
    private String engineNumber;

    @Column(
            name = "length"
    )
    private Double length;

    @Column(
            name = "hight"
    )
    private Double hight;

    @Column(
            name = "enging_power",
            length= 32
    )
    private String engingPower;

    @Column(
            name = "fuel_type",
            length= 32
    )
    private String fuelType;

    @Column(
            name = "cylinder_number",
            length= 32
    )
    private String cylinderNumber;


    @OneToOne(targetEntity =GpConfigPo.class,cascade = CascadeType.DETACH ,fetch = FetchType.LAZY)
    @JsonIdentityInfo(generator=ObjectIdGenerators.UUIDGenerator.class,property="@gp_id")
    private GpConfigPo  gpConfigPo;

    @Column(
            name="start_date"
    )
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startDate;
    @Column(
            name="end_date"
    )
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;
    @Column(
            name = "number_of_blades",
            length= 32
    )
    private String numberOfBlades;
    @Column(
            name = "wingspan"
    )
    private Double wingspan;

    @Column(
            name = "cabin_space_length"
    )
    private Double cabinSpaceLength;

    @Column(
            name = "cabin_space_height"
    )
    private Double cabinSpaceHeight;

    @Column(
            name = "cabin_space_width"
    )
    private Double cabinSpaceWidth;


    @Column(
            name = "empty_weight"
    )
    private Double emptyWeight;

    @Column(
            name = "maximum_take_off_weight"
    )
    private Double maximumTakeOffWeight;

    @Column(
            name = "maximum_available_load"
    )
    private Double maximumAvailableLoad;

    @Column(
            name = "maximum_tank_capacity"
    )
    private Double maximumTankCapacity;

    @Column(
            name = "maximum_cruise_speed"
    )
    private Double maximumCruiseSpeed;

    @Column(
            name = "maximum_range"
    )
    private Double maximumRange;

    @Column(
            name = "maximum_slip_before_weight"
    )
    private Double maximumSlipBeforeWeight;

    @Column(
            name = "maximum_landing_weight"
    )
    private Double maximumLandingWeight;

    @Column(
            name = "maximum_zero_fuel_weight"
    )
    private Double maximumZeroFuelWeight;

    @Column(
            name = "maximum_flying_height"
    )
    private Double maximumFlyingHeight;

    @Column(
            name = "maximum_climbing_speed_of_seaLevel"
    )
    private Double maximumClimbingSpeedOfSeaLevel;

    @Column(
            name = "the_time_of_navigation_at_the_best_speed"
    )
    private Double theTimeOfNavigationAtTheBestSpeed;

    @Column(
            name = "maximum_flying_speed"
    )
    private Double maximumFlyingSpeed;

    @Column(
            name = "load_number"
    )
    
    private Integer LoadNumber;

    @Column(
            name = "bearing_weight_of_inner_silo"
    )
    
    private Double  bearingWeightOfInnerSilo;
    @Column(
            name = "inner_bin_volume"
    )
    private Double  innerBinVolume;

    @Column(
            name = "outer_bin_volume"
    )
    private Double outerBinVolume;

    @Column(
            name = "outer_bin_weight"
    )
    private Double outerBinWeight;
    @Column(
            name = "take_off_runway_length"
    )
    private Double takeoffRunwayLength;
    @Column(
            name = "single_rise_and_down_line",
            length=50
    )
    private String  SingleRiseAndDownLine;
    @Column(
            name = "remote_cruise_speed"
    )
    private Double  remoteCruiseSpeed;
    @Column(
            name = "high_speed_cruise_speed"
    )
    private Double highSpeedCruiseSpeed;
    @Column(
            name = "flank_ratio"
    )
    private Double flankRatio;

    @Column(
            name = "wing_area"
    )
    private Double wingArea;
    @Column(
            name = "main_wheelbase"
    )
    private Double mainWheelbase;
    @Column(
            name = "front_main_wheelbase"
    )
    private Double frontMainWheelbase;
    @Column(
            name = "ground_spacing_of_the_fuselage"
    )
    private Double groundSpacingOfTheFuselage;
    @Column(
            name = "maximum_business_load"
    )
    private Double maximumBusinessLoad;
    @Column(
            name = "maximum_flat_speed"
    )
    private Double maximumFlatSpeed;
    @Column(
            name = "cruising_speed"
    )
    private Double cruisingSpeed;

    @Column(
            name = "practical_lift"
    )
    private Double practicalLift;

    @Column(
            name = "landing_skating_sistance"
    )
    private Double landingSkatingDistance;

    @Column(
            name = "takeoff_distance"
    )
    private Double takeoffDistance;




    @OneToMany(targetEntity=MaintenancePlanSettingPo.class, cascade = CascadeType.REMOVE, fetch = FetchType.LAZY,mappedBy = "flightInfoPo")
    private Set<MaintenancePlanSettingPo> maintenancePlanSettings;


    @OneToMany(targetEntity=RepairPlaneSettingPo.class, cascade = CascadeType.REMOVE, fetch = FetchType.LAZY ,mappedBy = "flightInfoPo")
    private Set<RepairPlaneSettingPo> repairPlaneSettings;

    public String getFlightInfoId() {
        return flightInfoId;
    }

    public void setFlightInfoId(String flightInfoId) {
        this.flightInfoId = flightInfoId;
    }

    public String getFlightType() {
        return flightType;
    }

    public void setFlightType(String flightType) {
        this.flightType = flightType;
    }

    public String getFlightNum() {
        return flightNum;
    }

    public void setFlightNum(String flightNum) {
        this.flightNum = flightNum;
    }

    public String getEngineNumber() {
        return engineNumber;
    }

    public void setEngineNumber(String engineNumber) {
        this.engineNumber = engineNumber;
    }

    public Double getLength() {
        return length;
    }

    public void setLength(Double length) {
        this.length = length;
    }

    public Double getHight() {
        return hight;
    }

    public void setHight(Double hight) {
        this.hight = hight;
    }

    public Double getWingspan() {
        return wingspan;
    }

    public void setWingspan(Double wingspan) {
        this.wingspan = wingspan;
    }

    public Double getCabinSpaceLength() {
        return cabinSpaceLength;
    }

    public void setCabinSpaceLength(Double cabinSpaceLength) {
        this.cabinSpaceLength = cabinSpaceLength;
    }

    public Double getCabinSpaceHeight() {
        return cabinSpaceHeight;
    }

    public void setCabinSpaceHeight(Double cabinSpaceHeight) {
        this.cabinSpaceHeight = cabinSpaceHeight;
    }

    public Double getCabinSpaceWidth() {
        return cabinSpaceWidth;
    }

    public void setCabinSpaceWidth(Double cabinSpaceWidth) {
        this.cabinSpaceWidth = cabinSpaceWidth;
    }

    public Double getEmptyWeight() {
        return emptyWeight;
    }

    public void setEmptyWeight(Double emptyWeight) {
        this.emptyWeight = emptyWeight;
    }

    public Double getMaximumTakeOffWeight() {
        return maximumTakeOffWeight;
    }

    public void setMaximumTakeOffWeight(Double maximumTakeOffWeight) {
        this.maximumTakeOffWeight = maximumTakeOffWeight;
    }

    public Double getMaximumAvailableLoad() {
        return maximumAvailableLoad;
    }

    public void setMaximumAvailableLoad(Double maximumAvailableLoad) {
        this.maximumAvailableLoad = maximumAvailableLoad;
    }

    public Double getMaximumTankCapacity() {
        return maximumTankCapacity;
    }

    public void setMaximumTankCapacity(Double maximumTankCapacity) {
        this.maximumTankCapacity = maximumTankCapacity;
    }

    public Double getMaximumCruiseSpeed() {
        return maximumCruiseSpeed;
    }

    public void setMaximumCruiseSpeed(Double maximumCruiseSpeed) {
        this.maximumCruiseSpeed = maximumCruiseSpeed;
    }

    public Double getMaximumRange() {
        return maximumRange;
    }

    public void setMaximumRange(Double maximumRange) {
        this.maximumRange = maximumRange;
    }

    public Double getMaximumSlipBeforeWeight() {
        return maximumSlipBeforeWeight;
    }

    public void setMaximumSlipBeforeWeight(Double maximumSlipBeforeWeight) {
        this.maximumSlipBeforeWeight = maximumSlipBeforeWeight;
    }

    public Double getMaximumLandingWeight() {
        return maximumLandingWeight;
    }

    public void setMaximumLandingWeight(Double maximumLandingWeight) {
        this.maximumLandingWeight = maximumLandingWeight;
    }

    public Double getMaximumZeroFuelWeight() {
        return maximumZeroFuelWeight;
    }

    public void setMaximumZeroFuelWeight(Double maximumZeroFuelWeight) {
        this.maximumZeroFuelWeight = maximumZeroFuelWeight;
    }

    public Double getMaximumFlyingHeight() {
        return maximumFlyingHeight;
    }

    public void setMaximumFlyingHeight(Double maximumFlyingHeight) {
        this.maximumFlyingHeight = maximumFlyingHeight;
    }

    public Double getMaximumClimbingSpeedOfSeaLevel() {
        return maximumClimbingSpeedOfSeaLevel;
    }

    public void setMaximumClimbingSpeedOfSeaLevel(Double maximumClimbingSpeedOfSeaLevel) {
        this.maximumClimbingSpeedOfSeaLevel = maximumClimbingSpeedOfSeaLevel;
    }

    public Double getTheTimeOfNavigationAtTheBestSpeed() {
        return theTimeOfNavigationAtTheBestSpeed;
    }

    public void setTheTimeOfNavigationAtTheBestSpeed(Double theTimeOfNavigationAtTheBestSpeed) {
        this.theTimeOfNavigationAtTheBestSpeed = theTimeOfNavigationAtTheBestSpeed;
    }

    public Double getMaximumFlyingSpeed() {
        return maximumFlyingSpeed;
    }

    public void setMaximumFlyingSpeed(Double maximumFlyingSpeed) {
        this.maximumFlyingSpeed = maximumFlyingSpeed;
    }

    public Integer getLoadNumber() {
        return LoadNumber;
    }

    public void setLoadNumber(Integer loadNumber) {
        LoadNumber = loadNumber;
    }

    public Double getBearingWeightOfInnerSilo() {
        return bearingWeightOfInnerSilo;
    }

    public void setBearingWeightOfInnerSilo(Double bearingWeightOfInnerSilo) {
        this.bearingWeightOfInnerSilo = bearingWeightOfInnerSilo;
    }

    public Double getInnerBinVolume() {
        return innerBinVolume;
    }

    public void setInnerBinVolume(Double innerBinVolume) {
        this.innerBinVolume = innerBinVolume;
    }

    public Double getOuterBinVolume() {
        return outerBinVolume;
    }

    public void setOuterBinVolume(Double outerBinVolume) {
        this.outerBinVolume = outerBinVolume;
    }

    public Double getOuterBinWeight() {
        return outerBinWeight;
    }

    public void setOuterBinWeight(Double outerBinWeight) {
        this.outerBinWeight = outerBinWeight;
    }

    public Double getTakeoffRunwayLength() {
        return takeoffRunwayLength;
    }

    public void setTakeoffRunwayLength(Double takeoffRunwayLength) {
        this.takeoffRunwayLength = takeoffRunwayLength;
    }

    public String getSingleRiseAndDownLine() {
        return SingleRiseAndDownLine;
    }

    public void setSingleRiseAndDownLine(String singleRiseAndDownLine) {
        SingleRiseAndDownLine = singleRiseAndDownLine;
    }

    public Double getRemoteCruiseSpeed() {
        return remoteCruiseSpeed;
    }

    public void setRemoteCruiseSpeed(Double remoteCruiseSpeed) {
        this.remoteCruiseSpeed = remoteCruiseSpeed;
    }

    public Double getHighSpeedCruiseSpeed() {
        return highSpeedCruiseSpeed;
    }

    public void setHighSpeedCruiseSpeed(Double highSpeedCruiseSpeed) {
        this.highSpeedCruiseSpeed = highSpeedCruiseSpeed;
    }

    public Double getFlankRatio() {
        return flankRatio;
    }

    public void setFlankRatio(Double flankRatio) {
        this.flankRatio = flankRatio;
    }

    public Double getWingArea() {
        return wingArea;
    }

    public void setWingArea(Double wingArea) {
        this.wingArea = wingArea;
    }

    public Double getMainWheelbase() {
        return mainWheelbase;
    }

    public void setMainWheelbase(Double mainWheelbase) {
        this.mainWheelbase = mainWheelbase;
    }

    public Double getFrontMainWheelbase() {
        return frontMainWheelbase;
    }

    public void setFrontMainWheelbase(Double frontMainWheelbase) {
        this.frontMainWheelbase = frontMainWheelbase;
    }

    public Double getGroundSpacingOfTheFuselage() {
        return groundSpacingOfTheFuselage;
    }

    public void setGroundSpacingOfTheFuselage(Double groundSpacingOfTheFuselage) {
        this.groundSpacingOfTheFuselage = groundSpacingOfTheFuselage;
    }

    public Double getMaximumBusinessLoad() {
        return maximumBusinessLoad;
    }

    public void setMaximumBusinessLoad(Double maximumBusinessLoad) {
        this.maximumBusinessLoad = maximumBusinessLoad;
    }

    public Double getMaximumFlatSpeed() {
        return maximumFlatSpeed;
    }

    public void setMaximumFlatSpeed(Double maximumFlatSpeed) {
        this.maximumFlatSpeed = maximumFlatSpeed;
    }

    public Double getCruisingSpeed() {
        return cruisingSpeed;
    }

    public void setCruisingSpeed(Double cruisingSpeed) {
        this.cruisingSpeed = cruisingSpeed;
    }

    public Double getPracticalLift() {
        return practicalLift;
    }

    public void setPracticalLift(Double practicalLift) {
        this.practicalLift = practicalLift;
    }

    public Double getLandingSkatingDistance() {
        return landingSkatingDistance;
    }

    public void setLandingSkatingDistance(Double landingSkatingDistance) {
        this.landingSkatingDistance = landingSkatingDistance;
    }

    public Double getTakeoffDistance() {
        return takeoffDistance;
    }

    public void setTakeoffDistance(Double takeoffDistance) {
        this.takeoffDistance = takeoffDistance;
    }

    public Double getPropellerDiameter() {
        return propellerDiameter;
    }

    public void setPropellerDiameter(Double propellerDiameter) {
        this.propellerDiameter = propellerDiameter;
    }

    public Double getCenterDistanceOfPropeller() {
        return centerDistanceOfPropeller;
    }

    public void setCenterDistanceOfPropeller(Double centerDistanceOfPropeller) {
        this.centerDistanceOfPropeller = centerDistanceOfPropeller;
    }

    @Column(
            name = "propeller_diameter"
    )
    private Double propellerDiameter;
    @Column(
            name = "center_distance_of_propeller"
    )
    private Double centerDistanceOfPropeller;


    public void setMaintenancePlanSettings(Set<MaintenancePlanSettingPo> maintenancePlanSettings) {
        this.maintenancePlanSettings = maintenancePlanSettings;
    }

    public void setRepairPlaneSettings(Set<RepairPlaneSettingPo> repairPlaneSettings) {
        this.repairPlaneSettings = repairPlaneSettings;
    }

    public Set<MaintenancePlanSettingPo> getMaintenancePlanSettings() {
        return (Set<MaintenancePlanSettingPo>) Loaded.loaded(maintenancePlanSettings);
    }

    public Set<RepairPlaneSettingPo> getRepairPlaneSettings() {
        return (Set<RepairPlaneSettingPo>) Loaded.loaded(repairPlaneSettings);
    }
//com.fasterxml.jackson.databind.JsonMappingException:
// No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer
// and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
// (through reference chain: com.kun.portal.webframe.po.CourseNodePo["flightPlanePo"]->com.kun.portal.webframe.po.FlightPlanePo_$$_jvstce9_1e["handler"])

    public String getManufacturingNo() {
        return manufacturingNo;
    }

    public void setManufacturingNo(String manufacturingNo) {
        this.manufacturingNo = manufacturingNo;
    }

    public Date getMakeDate() {
        return makeDate;
    }

    public void setMakeDate(Date makeDate) {
        this.makeDate = makeDate;
    }

    public String getFlightNo() {
        return flightNo;
    }

    public String getEngingPower() {
        return engingPower;
    }

    public void setEngingPower(String engingPower) {
        this.engingPower = engingPower;
    }

    public String getFuelType() {
        return fuelType;
    }

    public void setFuelType(String fuelType) {
        this.fuelType = fuelType;
    }

    public String getCylinderNumber() {
        return cylinderNumber;
    }

    public void setCylinderNumber(String cylinderNumber) {
        this.cylinderNumber = cylinderNumber;
    }

    public String getNumberOfBlades() {
        return numberOfBlades;
    }

    public void setNumberOfBlades(String numberOfBlades) {
        this.numberOfBlades = numberOfBlades;
    }

    public void setFlightNo(String flightNo) {
        this.flightNo = flightNo;
    }

    public Boolean getEffective() {
        return effective;
    }

    public void setEffective(Boolean effective) {
        this.effective = effective;
    }


    public GpConfigPo getGpConfigPo() {
        return (GpConfigPo) Loaded.loaded(gpConfigPo);
    }

    public void setGpConfigPo(GpConfigPo gpConfigPo) {
        this.gpConfigPo = gpConfigPo;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
}
